/**
 * 通用接口
 */
import type { CommonAddressResult, CommonConfigCliResult } from './types';
import { get } from '@/utils/request';

enum URL {
  /*
  upload = '/common/upload',
  sendCode = '/sendCode',
  */

  commonConfigCli = '/common/config/cli',
  commonAddress = '/common/address',
  commonConfigRank = '/common/config/rank',
}

/*
// [demo]图片上传
export const uploadImage = (imagePath: string) =>
  upload<UploadImageResult>({ url: URL.upload, filePath: imagePath, name: 'file' });

// [demo]发送验证码
export const sendCode = (data: SendCodeParams) => post<SendCodeResult>({ url: URL.sendCode, data });
*/

/* 配置列表-客户端 */
export const commonConfigCli = () => get<CommonConfigCliResult>({ url: URL.commonConfigCli });
/* 配置-省市区 */
export const commonAddress = () => get<CommonAddressResult>({ url: URL.commonAddress });
/* 配置搜索排行 */
export const commonConfigRank = () => get<CommonConfigCliResult>({ url: URL.commonConfigRank });
export const schoolList = () => get<CommonConfigCliResult>({ url: '/school/list' });
export const schoolDetail = (params: any) => get<CommonConfigCliResult>({ url: '/school/college/list', params:params});

export const projectList = (params: any) => get<CommonConfigCliResult>({ url: '/school/major/list', params: params });
